#pragma once

/*$FILE************************************************************************

Module             PlSqlDevPlugIn

File               PlSqlDevFunctions.h

Contents           Pl/Sql Developer Plug-In Interface

Created            Vladimir Schneider
www.winpte.com
www.beyondedit.com

Sep 10, 2006

Copyright (c) 2006 Vladimir Schneider, All Rights Reserved

1.                 Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the
following conditions are met:

2.                 Neither the name of WinPTE, BeyondEdit nor the
names of its contributors may be used to endorse or
promote products derived from this software without
specific prior written permission.


THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE.

******X******************X************************X************************X$*/

#ifndef __PlSqlDevFunctions_h_
#define __PlSqlDevFunctions_h_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

#ifndef _NO_PACK_
#pragma pack(push, 4)
#endif

//Functions to export to PL/SQL Dev
extern "C"
{
	__declspec(dllexport) void RegisterCallback(int nIndex, void *pvAddr);
	__declspec(dllexport) char* IdentifyPlugIn(int);
	__declspec(dllexport) void OnCreate();
	__declspec(dllexport) void OnActivate();
//	__declspec(dllexport) void OnDeactivate();
	__declspec(dllexport) void OnDestroy();
//	__declspec(dllexport) BOOL CanClose();
//	__declspec(dllexport) void AfterStart();

	__declspec(dllexport) char* CreateMenuItem(int);
	__declspec(dllexport) void OnMenuClick(int);

	// uncomment the ones that are of interest
//	__declspec(dllexport) void OnBrowserChange();
//	__declspec(dllexport) void OnWindowChange();
	__declspec(dllexport) void OnConnectionChange();
//	__declspec(dllexport) void OnWindowConnectionChange();
//	__declspec(dllexport) int OnWindowClose(int WindowType, BOOL Changed);
//	__declspec(dllexport) void OnWindowCreate(int WindowType);
//	__declspec(dllexport) void OnWindowCreated(int WindowType);
//	__declspec(dllexport) BOOL BeforeExecuteWindow(int WindowType);
//	__declspec(dllexport) void AfterExecuteWindow(int WindowType, int Result);
	__declspec(dllexport) void Configure();

//	__declspec(dllexport) void OnPopup(char *ObjectType, char *ObjectName);
//	__declspec(dllexport) void OnMainMenu(char *MenuName);
	__declspec(dllexport) char *About();
//	__declspec(dllexport) BOOL OnTemplate(char *Filename, char **Data);
//	__declspec(dllexport) void OnFileLoaded(int WindowType, int Mode);
//	__declspec(dllexport) void OnFileSaved(int WindowType, int Mode);
	__declspec(dllexport) char *PlugInName();
	__declspec(dllexport) char *PlugInSubName();
	__declspec(dllexport) char *PlugInShortName();

//	__declspec(dllexport) void CommandLine(int FeedbackHandle, char *Command, char *Params);

// __declspec(dllexport) char *RegisterFileSystem();
// __declspec(dllexport) char *DirectFileLoad(char *Tag, char *Filename, int WindowType);
// __declspec(dllexport) BOOL DirectFileSave(char *Tag, char *Filename, int WindowType);
// __declspec(dllexport) char *RegisterExport();
// __declspec(dllexport) void ExportInit();
// __declspec(dllexport) void ExportFinished();
// __declspec(dllexport) void ExportPrepare();
// __declspec(dllexport) void ExportData();
}

// tab type returned by IDE_TabInfo()
#define PLSQL_TT_FUNCTION                         "Function"
#define PLSQL_TT_PROCEDURE                        "Procedure"
#define PLSQL_TT_TRIGGER                          "Trigger"
#define PLSQL_TT_JAVA_SOURCE                      "Java source"
#define PLSQL_TT_PACKAGE_SPEC                     "Package"
#define PLSQL_TT_PACKAGE_BODY                     "Package body"
#define PLSQL_TT_TYPE_SPEC                        "Type"
#define PLSQL_TT_TYPE_BODY                        "Type body"

// object type returned by IDE_GetPopupObject()
#define PLSQL_TY_VIEW                             "VIEW"
#define PLSQL_TY_FUNCTION                         "FUNCTION"
#define PLSQL_TY_PROCEDURE                        "PROCEDURE"
#define PLSQL_TY_TRIGGER                          "TRIGGER"
#define PLSQL_TY_JAVA_SOURCE                      "JAVA SOURCE"
#define PLSQL_TY_PACKAGE_SPEC                     "PACKAGE"
#define PLSQL_TY_PACKAGE_BODY                     "PACKAGE BODY"
#define PLSQL_TY_TYPE_SPEC                        "TYPE"
#define PLSQL_TY_TYPE_BODY                        "TYPE BODY"

// window type
#define PLSQL_WT_UNKNOWN                          0
#define PLSQL_WT_SQL                              1
#define PLSQL_WT_TEST                             2
#define PLSQL_WT_PROCEDURE                        3
#define PLSQL_WT_COMMAND                          4
#define PLSQL_WT_PLAN                             5
#define PLSQL_WT_REPORT                           6

// cursor word position
#define PLSQL_CWP_UNKNOWN                         0
#define PLSQL_CWP_CURSOR_START_WORD               1
#define PLSQL_CWP_CURSOR_WORD                     2
#define PLSQL_CWP_CURSOR_END_WORD                 3

// perform
#define PLSQL_PERFORM_EXECUTE                     1
#define PLSQL_PERFORM_BREAK                       2
#define PLSQL_PERFORM_KILL                        3
#define PLSQL_PERFORM_COMMIT                      4
#define PLSQL_PERFORM_ROLLBACK                    5
#define PLSQL_PERFORM_PRINT                       6

// keyword style
#define PLSQL_KWS_CUSTOM                          10
#define PLSQL_KWS_KEYWORDS                        11
#define PLSQL_KWS_COMMENT                         12
#define PLSQL_KWS_STRINGS                         13
#define PLSQL_KWS_NUMBERS                         14
#define PLSQL_KWS_SYMBOLS                         15

// popup
#define PLSQL_POPUP_PROGRAMWINDOW                 "PROGRAMWINDOW"
#define PLSQL_POPUP_SQLWINDOW                     "SQLWINDOW"
#define PLSQL_POPUP_TESTWINDOW                    "TESTWINDOW"
#define PLSQL_POPUP_COMMANDWINDOW                 "COMMANDWINDOW"

// refresh object
#define PLSQL_REFRESH_OBJECT_CREATED              1
#define PLSQL_REFRESH_OBJECT_MODIFIED             2
#define PLSQL_REFRESH_OBJECT_DELETED              3

// key simulation
#define PLSQL_KP_SHIFT   1
#define PLSQL_KP_ALT     2
#define PLSQL_KP_CTRL    3

// beautifier options
#define PLSQL_BO_AfterCreating                    1
#define PLSQL_BO_AfterLoading                     2
#define PLSQL_BO_BeforeCompiling                  4
#define PLSQL_BO_BeforeSaving                     8

// sql field type
#define PLSQL_FT_Integer                          3
#define PLSQL_FT_Float                            4
#define PLSQL_FT_String                           5
#define PLSQL_FT_Long                             8
#define PLSQL_FT_Date                             12
#define PLSQL_FT_LongRaw                          24

// SYSTEM Info functions

// Returns the PL/SQL Developer main and subversion, for example 210 for version 2.1.0. This
// might be useful if you want to use functions that are not available in all versions.
/*FUNC: 1*/ extern int(*SYS_Version)();

// Returns the registry root name of PL/SQL Developer in HKEY_CURRENT_USER (usually
// �Software\PL/SQL Developer?. If you want to save your settings in the registry, you can
// create a section within the PL/SQL Developer section.
//
// Note: In PL/SQL Developer 3.1, the registry section is moved to: (�Software\Allround
// Automations\PL/SQL Developer?
/*FUNC: 2*/ extern char *(*SYS_Registry)();

// The directory where PL/SQL Developer is installed, for example �C:\Program Files\PLSQL
// Developer?
/*FUNC: 3*/ extern char *(*SYS_RootDir)();

// The Oracle directory, for example �C:\Orawin95?
/*FUNC: 4*/ extern char *(*SYS_OracleHome)();

// Returns the path of the OCI DLL that is used by PL/SQL Developer. If you want to initialize
// a new session, you might want to use this value if you want to make sure you�re using the
// same OCI version.
// Available in version 300
/*FUNC: 5*/ extern char *(*SYS_OCIDLL)();

// Returns True if PL/SQL Developer is currently connected in OCI8 Mode (Net8).
// Available in version 300
/*FUNC: 6*/ extern BOOL* (*SYS_OCI8Mode)();

// Returns if PL/SQL Developer is currently using the visual XP style.
// Available in version 700
/*FUNC: 7*/ extern BOOL *(*SYS_XPStyle)();

// If Param is empty, the function will return the full tnsnames filename.
// If Param has a value, the connection details of the alias as specified by
// Param is returned. If Param is *, the connection details of the current
// connection are returned). The return value can look like:
// TEST =
// (DESCRIPTION =
//     (ADDRESS_LIST =
//         (ADDRESS = (PROTOCOL = TCP)(HOST = p2800)(PORT = 1521))
//     )
//     (CONNECT_DATA =
//         (SERVER = DEDICATED)
//         (SERVICE_NAME = AAA)
//     )
// )
// Available in version 700
/*FUNC: 8*/ extern char* (*SYS_TNSNAMES)(char *Param);

// Returns the Delphi version used to build PL/SQL Developer. Only useful
// for very specific functions.
/*FUNC: 9*/ extern int(*SYS_DelphiVersion)();

// IDE functions

// Use this function to enable or disable a menu. The ID is the Plug-In ID, which is given by
// the IdentifyPlugIn function. The Index is the menu index, which the menu was related to by
// the CreateMenuItem function. The Enabled boolean determines if the menu item is enabled or
// grayed.
/*FUNC: 10*/ extern void(*IDE_MenuState)(int ID, int Index, BOOL Enabled);

// Returns a boolean that indicates if PL/SQL Developer is currently connected to a database.
/*FUNC: 11*/ extern BOOL(*IDE_Connected)();

// Returns the username, password and database of the current connection.
/*FUNC: 12*/ extern void(*IDE_GetConnectionInfo)(char **Username, char **Password, char **Database);

// Returns information about the selected item in the Browser. If no item is selected, all items are empty.
/*FUNC: 13*/ extern void(*IDE_GetBrowserInfo)(char **ObjectType, char **ObjectOwner, char **ObjectName);

// Returns the type of the current window.
// 1 = SQL Window
// 2 = Test Window
// 3 = Procedure Window
// 4 = Command Window
// 5 = Plan Window
// 6 = Report Window
// 0 = None of the above
/*FUNC: 14*/ extern int(*IDE_GetWindowType)();

// Returns the Application handle of PL/SQL Developer
/*FUNC: 15*/ extern int(*IDE_GetAppHandle)();

// Returns the handle of PL/SQL Developers main window
/*FUNC: 16*/ extern HWND(*IDE_GetWindowHandle)();

// Returns the handle of PL/SQL Developers client window
/*FUNC: 17*/ extern HWND(*IDE_GetClientHandle)();

// Returns the handle of the active child form
/*FUNC: 18*/ extern HWND(*IDE_GetChildHandle)();

// Resets the state of the menus, buttons and the active window.  You can call this function if
// you made some changes that affect the state of a menu or window which are unnoticed by PL/SQL
// Developer.
//
// Available in version 213
/*FUNC: 19*/ extern void(*IDE_Refresh)();

// Creates a new window. The Text parameter contains text that is placed in the window. If the Execute Boolean is true, the Window will be executed.
// WindowType can be one of the following values:
// 1 = SQL Window
// 2 = Test Window
// 3 = Procedure Window
// 4 = Command Window
// 5 = Plan Window
// 6 = Report Window
/*FUNC: 20*/ extern void(*IDE_CreateWindow)(int WindowType, char *Text, BOOL Execute);

// Creates a window of type WindowType and loads the specified file.
// WindowType can be one of the following values:
// 1 = SQL Window
// 2 = Test Window
// 3 = Procedure Window
// 4 = Command Window
// The function returns True if successful.
//
// Version 301 and higher
// If you pass 0 as WindowType, PL/SQL Developer will try to determine the actual WindowType on the extension of the filename.
/*FUNC: 21*/ extern BOOL(*IDE_OpenFile)(int WindowType, char *Filename);

// This function saves the current window. It returns True if successful.
/*FUNC: 22*/ extern BOOL(*IDE_SaveFile)();

// Return the filename of the current child window.
// See also IDE_SetFilename()
/*FUNC: 23*/ extern char *(*IDE_Filename)();

// Closes the current child window
/*FUNC: 24*/ extern void(*IDE_CloseFile)();

// Set the ReadOnly status of the current Window
/*FUNC: 25*/ extern void(*IDE_SetReadOnly)(BOOL ReadOnly);

// Get the ReadOnly status of the current Window
// Available in version 213
/*FUNC: 26*/ extern BOOL(*IDE_GetReadOnly)();

// This function will execute a query (SQL parameter) and display the result in a �result only?
// SQL Window. Title will be used as the window name and the Updateable parameter determines if
// the results are updateable.
//
// Available in version 300
/*FUNC: 27*/ extern BOOL(*IDE_ExecuteSQLReport)(char *SQL, char *Title, BOOL Updateable);

// Forces the active child window to reload its file from disk.  Note: In PL/SQL Developer 4
// there will no longer be a warning message when modifications were made.
// Available in version 301
/*FUNC: 28*/ extern BOOL(*IDE_ReloadFile)();

// Set the filename of the active child window. The filename should contain a valid path, but
// the file does not need to exist. The new filename will be used when the file is saved.  If
// the Filename parameter is an empty string, the Window will behave as a new created Window.
//
// Available in version 303
/*FUNC: 29*/ extern void(*IDE_SetFilename)(char *Filename);

// Retrieves the text from the current child window.
/*FUNC: 30*/ extern char *(*IDE_GetText)();

// Retrieves the selected text from the current child window.
/*FUNC: 31*/ extern char *(*IDE_GetSelectedText)();

// Retrieves the word the cursor is on in the current child window.
/*FUNC: 32*/ extern char *(*IDE_GetCursorWord)();

// Returns the handle of the editor of the current child window.
/*FUNC: 33*/ extern HWND(*IDE_GetEditorHandle)();

// Sets the text in the editor of current window. If this failed for some reason (ReadOnly?),
// the function returns false.
//
// Available in version 213
/*FUNC: 34*/ extern BOOL(*IDE_SetText)(char *Text);

// Places a message in the status bar of the current window, returns false if the window did not
// have a status bar.
//
// Available in version 213
/*FUNC: 35*/ extern BOOL(*IDE_SetStatusMessage)(char *Text);

// Highlights the given line and places the cursor at the given position.  This will only work
// when the active window is a procedure window, if not, the function returns false.
//
// Available in version 213
/*FUNC: 36*/ extern BOOL(*IDE_SetErrorPosition)(int Line, int Col);

// Resets the highlighted lines.
// Available in version 213
/*FUNC: 37*/ extern void(*IDE_ClearErrorPositions)();

// This function returns the location of the cursor in the word after a call to
// IDE_GetCursorWord. Possible return values:
//
//   0: Unknown
//   1: Cursor was at start of word
//   2: Cursor was somewhere in the middle
//   3: Cursor was at the end
//
// Available in version 400
/*FUNC: 38*/ extern int(*IDE_GetCursorWordPosition)();

// This function allows you to perform a specific action as if the menu item as specified in
// Param was selected. The following values are supported:
//   1: Execute
//   2: Break
//   3: Kill
//   4: Commit
//   5: Rollback
//   6: Print
//
// Available in version 400
/*FUNC: 39*/ extern BOOL(*IDE_Perform)(int Param);

// Returns a list of all keywords as entered in the �custom keywords?option in the Editor
// preference.
//
// Available in version 300
/*FUNC: 60*/ extern char *(*IDE_GetCustomKeywords)();

// Fills the custom keywords with the words in the Keywords parameter. Words should be
// separated by cr/lf. The currently used keywords will be overwritten.
//
// Available in version 300
/*FUNC: 61*/ extern void(*IDE_SetCustomKeywords)(char *Keywords);

// Adds a number of keywords with a specific style.  This function is more specific then
// IDE_SetCustomKeywords because this one can set multiple sets of keywords for different
// highlighting styles.  ID should be the PlugIn ID as returned by the IdentifyPlugIn function.
// Style can be one of the following values:
// 10: Custom
// 11: Keywords
// 12: Comment
// 13: Strings
// 14: Numbers
// 15: Symbols
// Keywords is a cr/lf separated list of words. You can define one list per style.
// Available in version 300
/*FUNC: 62*/ extern void(*IDE_SetKeywords)(int ID, int Style, char *Keywords);

// Activates the keywords as defined by the IDE_SetKeywords function.
// Available in version 300
/*FUNC: 63*/ extern void(*IDE_ActivateKeywords)();

// When this function is called, all menus for this Plug-In are removed and CreateMenuItem will
// be called to build a new set of menus. This only makes sense if you supply a different set
// of menu-items.
//
// Available in version 300
/*FUNC: 64*/ extern void(*IDE_RefreshMenus)(int ID);

// This function allows you to rename a certain menu-item.
// ID is the Plug-In ID, Index is the Menu number and name is the new menu name.
// Available in version 300
/*FUNC: 65*/ extern void(*IDE_SetMenuName)(int ID, int Index, char *Name);

// You can display or remove a check mark for a menu-item.
// Available in version 300
/*FUNC: 66*/ extern void(*IDE_SetMenuCheck)(int ID, int Index, BOOL Enabled);

// With this function you can hide or show a specific menu. You can use this instead of
// IDE_MenuState.
// Available in version 300
/*FUNC: 67*/ extern void(*IDE_SetMenuVisible)(int ID, int Index, BOOL Enabled);

// Returns a list of all standard PL/SQL Developer menu items. Items are separated by cr/lf and
// child menu level is indicated by a number of spaces.  You can use this function to build an
// advanced user configuration dialog where the user could be able to select place where he
// wants to insert the Plug-In menus.
//
// Available in version 300
/*FUNC: 68*/ extern char *(*IDE_GetMenulayout)();

// With this function you can add items to certain popup menus. The ID is the Plug-In ID and
// the index is the menu index. You can pass any number as the menu index, it can be an
// existing menu (as used by CreateMenuItem) or anything else. If the popup menu gets selected,
// OnMenuClick is called with the corresponding index.  The Name is the menu name as it will be
// displayed. The ObjectType determines in which popup menus this item will be displayed. Some
// possible values are: �TABLE? �VIEW? �PACKAGE? etc.
//
// Version 301 and higher
// If you pass one of the following values as ObjectType, you can add items to specific Windows.
//   PROGRAMWINDOW
//   SQLWINDOW
//   TESTWINDOW
//   COMMANDWINDOW
//
// Version 400 and higher
// You can add popup items to Object Browser items like Tables, Views, etc. by passing their
// name as ObjectType.
//
// Version 510 and higher
// If you want to create popup menus for multiple selected items (of the same object type), you
// can add a + to the ObjectType parameter like �TABLE+? �VIEW+? etc. The OnMenuClick will be
// called for every selected item, and the GetPopupObject will return the correct details.
//
// Available in version 300
/*FUNC: 69*/ extern void* (*IDE_CreatePopupItem)(int ID, int Index, char *Name, char *ObjectType);

// This function allows you to reconnect PL/SQL Developer as another user. The return value
// indicates if the connection was successful.  The function will fail if there is a childwindow
// with an active query.  Also see IDE_SetConnectionAs
// Available in version 301
/*FUNC: 70*/ extern BOOL(*IDE_SetConnection)(char *Username, char *Password, char *Database);

// This function returns Oracle information about the item in the AnObject parameter. The
// SubObject returns the name of the procedure if the Object is a packaged procedure.
//
// Available in version 400
/*FUNC: 71*/ extern int(*IDE_GetObjectInfo)(char *AnObject, char **ObjectType, char **ObjectOwner, char **ObjectName, char **SubObject);

// Returns a cr/lf separated list of items from the Object Browser. The Node parameter
// determines which items are returned. This can be one of the main items like TABLES, but you
// can also us a slash to get more specific items like TABLES/DEPT/COLUMNS.  The GetItems
// boolean determines if PL/SQL Developer will fetch these values from the database if the item
// has not been opened yet in the Browser.
//
// Available in version 400
/*FUNC: 72*/ extern char *(*IDE_GetBrowserItems)(char *Node, BOOL GetItems);

// Force a refresh to the Object Browser. If Node is empty, all items are refreshed. To
// refresh a specific item you can enter the name in the Node parameter.
//
// Note: Version 500 allows you to pass a * to refresh the current selected browser item.
//
// Available in version 400
// Note:
// Version 500 allows you to pass a * to refresh the current selected
// browser item.
// Note:
// Version 600 allows you to pass a ** to refresh to parent of the current
// browser item, and you can pass *** to refresh to root item.
/*FUNC: 73*/ extern void(*IDE_RefreshBrowser)(char *Node);

// This function returns information about the item for which a popup menu (created with
// IDE_CreatePopupItem) was activated.  If the item is a Browser folder, the name of the folder
// will be returned in ObjectName and ObjectType will return �FOLDER?
//
// Available in version 400
/*FUNC: 74*/ extern int(*IDE_GetPopupObject)(char **ObjectType, char **ObjectOwner, char **ObjectName, char **SubObject);

// This function returns the name of browser root item for which a popup menu (created with
// IDE_CreatePopupItem) was activated.
//
// Available in version 400
/*FUNC: 75*/ extern char *(*IDE_GetPopupBrowserRoot)();

// If you modify database objects in your Plug-In and you want to update PL/SQL Developer to
// reflect these changes, you can do so by calling this function. You should pass the object
// type, owner, name and the action that you performed on the object. The action can be one of
// the following:
//
//   1 = Object created
//   2 = Object modified
//   3 = Object deleted
//
// PL/SQL Developer will update the browser and all windows that might use the object.
//
// Available in version 400
/*FUNC: 76*/ extern void(*IDE_RefreshObject) (char *ObjectType, char *ObjectOwner, char *ObjectName, int Action);

// This function will return the details of the first selected in the Browser. The function
// will return false if no items are selected.  Use in combination with IDE_NextSelectedObject
// to determine all selected items.
//
// Available in version 500
/*FUNC: 77*/ extern BOOL(*IDE_FirstSelectedObject)(char *ObjectType, char *ObjectOwner, char *ObjectName, char *SubObject);

// This function can be called after a call to IDE_FirstSelectedObject to determine all selected
// objects. You can keep calling this function until it returns false.
//
// Available in version 500
/*FUNC: 78*/ extern BOOL(*IDE_NextSelectedObject)(char *ObjectType, char *ObjectOwner, char *ObjectName, char *SubObject);

// Returns the source for the specified object. This function will only return source for
// objects that actually have source (packages, views, ?.
//
// Available in version 511
/*FUNC: 79*/ extern char *(*IDE_GetObjectSource)(char *ObjectType, char *ObjectOwner, char *ObjectName);

// Returns the number of child windows in PL/SQL Developer. In combination with
// IDE_SelectWindow you can communicate with all child windows.
//
// Available in version 301
/*FUNC: 80*/ extern int(*IDE_GetWindowCount)();

// This function will �select?one of PL/SQL Developers child Windows. Index is the window
// number where 0 is the top child window. The return value will indicate if the window
// existed.
//
// Normally all window related functions communicate with the active child window. With this
// function you can select any window and all window-related IDE functions will refer to the
// selected window.
//
// Note: IDE_SelectWindow does not actually bring the window to front, you need
// IDE_ActivateWindow to do that.
//
// Available in version 301
/*FUNC: 81*/ extern BOOL(*IDE_SelectWindow)(int Index);

// Brings the Indexth child window with to front.
// Available in version 301
/*FUNC: 82*/ extern BOOL(*IDE_ActivateWindow)(int Index);

// Returns if the contents of the window is modified.
// Available in version 301
/*FUNC: 83*/ extern BOOL(*IDE_WindowIsModified)();

// Returns if there is anything running in the current window.
// Available in version 301
/*FUNC: 84*/ extern BOOL(*IDE_WindowIsRunning)();

// Returns if there is anything running in the current window.
// Available in version 301
/*FUNC: 85*/ extern int(*IDE_WindowPin)(int Pin);

// Creates an empty splash screen (the one you see when PL/SQL Developer is starting or
// printing) which allows you to show some kind of progress on lengthy operations.  If the
// ProgressMax parameter is larger then 0, a progress bar is displayed which you can advance
// with the IDE_SplashProgress function.
//
// Note: There can only be one splash screen active at a
// time. If a splash screen is created while one was active, the first one will get re-used.
//
// Available in version 303
/*FUNC: 90*/ extern void(*IDE_SplashCreate)(int ProgressMax);

// Hides the splash screen. This function will work on any splash screen, you can even hide the
// one created by PL/SQL Developer.
//
// Available in version 303
/*FUNC: 91*/ extern void(*IDE_SplashHide)();

// Add text to the splash screen.
// Available in version 303
/*FUNC: 92*/ extern void(*IDE_SplashWrite)(char *s);

// Add text to the splash screen beginning on the next line.
// Available in version 303
/*FUNC: 93*/ extern void(*IDE_SplashWriteLn)(char *s);

// If the splash screen was created with a progress bar, you can indicate progress with this function.
// Available in version 303
/*FUNC: 94*/ extern void(*IDE_SplashProgress)(int Progress);

// This function returns the path where the templates are located.
// Available in version 400
/*FUNC: 95*/ extern char *(*IDE_TemplatePath)();

// If you want to execute a template from within your PlugIn you can do so with this function.
// The NewWindow parameter indicates if a new window should be created or that the result of the
// template should be pasted at the current cursor position in the active window. The template
// parameter should contain the template name. If the template is located in one or more
// folders, the folder name(s) should be prefixed to the template name separated by a backslash.
//
// Available in version 400
/*FUNC: 96*/ extern BOOL(*IDE_ExecuteTemplate)(char *Template, BOOL NewWindow);

// Use this function to determine if the current connection has a specific �Connect As?
// Possible return values are: '', 'SYSDBA' and 'SYSOPER'
// Available in version 500
/*FUNC: 97*/ extern char *(*IDE_GetConnectAs)();

// Identical to IDE_SetConnection, but with an option to specify a ConnectAs parameter. You can
// pass 'SYSDBA' or 'SYSOPER', all other values will be handled as 'NORMAL'.
//
// Available in version 500
/*FUNC: 98*/ extern BOOL(*IDE_SetConnectionAs)(char *Username, char *Password, char *Database, char *ConnectAs);

//*****************************************************************************
//
//    External FileSystem functions
//
//****X******************X************************X************************X***

// If you want to create a new �File Open?menu with the same items as the standard menu, you
// can use this function to determine the standard items. You can call this function in a loop
// while incrementing MenuIndex (starting with 0) until the return value is an empty string.
// The return values are the menu names in the File Open menu and the WindowType is the
// corresponding window type.
//
// Available in version 400
/*FUNC: 100*/ extern char *(*IDE_GetFileOpenMenu)(int MenuIndex, int *WindowType);

// Returns True if the active child window can be saved. (which are the SQL, Test, Program and
// Command windows).
//
// Available in version 400
/*FUNC: 101*/ extern BOOL(*IDE_CanSaveWindow)();

// Creates a new Window (of type WindowType) for the specified (and registered) FileSystem, Tag
// and Filename.
//
// Available in version 400
/*FUNC: 102*/ extern void(*IDE_OpenFileExternal)(int WindowType, char *Data, char *FileSystem, char *Tag, char *Filename);

// Returns the defined filetypes for a specific WindowType.
//
// Available in version 400
/*FUNC: 103*/ extern char *(*IDE_GetFileTypes)(int WindowType);

// Returns the default extension (without period) for a specific window type.
// Available in version 400
/*FUNC: 104*/ extern char *(*IDE_GetDefaultExtension)(int WindowType);

// Returns the data of a window. You can use this function to get the data and save it.
//
// Available in version 400
/*FUNC: 105*/ extern char *(*IDE_GetFiledata)();

// You can call this function when a file is saved successfully. The filename will be set in
// the Window caption and the status will display that the file is �saved successfully?
// FileSystem and FileTag can be nil.
//
// Available in version 400
/*FUNC: 106*/ extern void(*IDE_FileSaved)(char *FileSystem, char *FileTag, char *Filename);

// This function displays a html file in a child window. The url parameter identifies the file
// and the hash parameter allows you to jump to a specific location. The title parameter will
// be used as window title.  You can refresh the contents of an already opened window by
// specifying an ID. If ID is not empty, and a window exists with the same ID, this will be
// used, otherwise a new window will be created.
//
// Available in version 510
/*FUNC: 107*/ extern BOOL(*IDE_ShowHTML)(char *Url, char *Hash, char *Title, char *ID);

// Refresh the contents of a HTML Window. You can pass a url to refress all windows that show a
// specific url, or you can pass an ID to refresh a specific Window.
//
// Available in version 512
/*FUNC: 108*/ extern BOOL(*IDE_RefreshHTML)(char *Url, char *ID, BOOL     BringToFront);

// Returns the define file extension of a specific object type. The oType parameter can hold
// one of the following values:
//
// FUNCTION
// PROCEDURE
// TRIGGER
// PACKAGE
// PACKAGE BODY
// PACKAGE SPEC AND BODY
// TYPE
// TYPE BODY
// TYPE SPEC AND BODY
// JAVA SOURCE
//
// Available in version 514
/*FUNC: 109*/ extern char *(*IDE_GetProcEditExtension)(char *oType);

// Get info about the object opened in a Window. This will only work for Program Windows.
//
// Available in version 512
/*FUNC: 110*/ extern BOOL(*IDE_GetWindowObject) (char **ObjectType, char **ObjectOwner, char **ObjectName, char **SubObject);

// Returns the first selected item in the file browser. Use
// IDE_NextSelectedFile for multiple selected items.The Files and
// Directories parameters allow you to specify if you do or don�t want
// selected files and / or directories
// Available in version 800
/*FUNC: 111*/ extern char *(*IDE_FirstSelectedFile)(BOOL Files, BOOL Directories);

// Returns the next selected item.See the previous function.
// Returns empty value when no more items
// Available in version 800
/*FUNC: 112*/ extern char *(*IDE_NextSelectedFile)();

// Forces the file browser to refresh the contents. Normally the browser will
// autodetect changes.
// Available in version 800
/*FUNC: 113*/ extern void (*IDE_RefreshFileBrowser)();

//*****************************************************************************
//
//    IDE functions
//
//****X******************X************************X************************X***

// Simulates a key press. You can use this function to do the things you can also do with the
// keyboard. The Key parameter is the virtual key code of the key, and the Shift parameter
// holds the status of the Shift Ctrl and Alt keys. You can combine the following values:
//  1 = Shift
//  2 = Alt
//  3 = Ctrl
// Available in version 510
/*FUNC: 120*/ extern void(*IDE_KeyPress)(int Key, int Shift);

// This function will return an �index?of a specific menu item. The MenuName parameter must
// specify the menu path separated by a slash, for example �edit / selection / uppercase? The
// menu name is not case sensitive. If the function returns zero, the menu did not exist.  You
// can use the return value with IDE_SelectMenu
// Available in version 510
/*FUNC: 121*/ extern int(*IDE_GetMenuItem)(char *MenuName);

// You can execute a menu item with this function. The MenuItem parameter has to be determined
// by the IDE_SelectMenu function. If this function returns false, the menu did not exist, or
// it was disabled.
// Available in version 510
/*FUNC: 122*/ extern BOOL(*IDE_SelectMenu)(int MenuItem);

// Returns a list of cr/lf separated menu items that can be used with
// IDE_GetMenuItem / IDE_SelectMenu.
// Available in version 1400
/*FUNC: 123 */extern char *(*IDE_GetMenuItemLayout)();

// Returns the currently used translation file. If the return value is empty, no translation is
// used.
// Available in version 510
/*FUNC: 130*/ extern char *(*IDE_TranslationFile)();

// Returns the language of the currently used translation file. If the return value is empty,
// no translation is used.
// Available in version 510
/*FUNC: 131*/ extern char *(*IDE_TranslationLanguage)();

// Returns a list of all standard PL/SQL Developer menu items like IDE_GetMenuLayout, but this
// function will return the translated menus.
// Available in version 510
/*FUNC: 132*/ extern char *(*IDE_GetTranslatedMenuLayout)();

//Return the PL / SQL Developer main font in the format :
//�Name? size, color, charset, �style?
// Available in version 510
/* FUNC: 133*/ extern char *(*IDE_MainFont)();

//Function for translating items.
// Available in version 510
/* FUNC: 134*/ extern char *(*IDE_TranslateItems)(char *Group);

// Function for translating items.
// Available in version 510
/* FUNC: 135*/ extern char *(*IDE_TranslateString)(char *ID, char *Default, char Param1, char Param2);

// PL/SQL Developer has a preference to save all opened files on a time interval, and/or when an
// Execute is performed. In case of a crash (from the system, Oracle or PL/SQL Dev), the user
// will be able to recover the edited files.  If the Plug-In can do things that have a possible
// risk of causing a crash, you can call this function to protect the user�s work.
//
// Available in version 510
/*FUNC: 140*/ extern BOOL(*IDE_SaveRecoveryFiles)();

// Returns the (1 based) character position of the cursor in the current editor.
// Available in version 510
/*FUNC: 141*/ extern int(*IDE_GetCursorX)();

// Returns the (1 based) line position of the cusror in the current editor.
// Available in version 510
/*FUNC: 142*/ extern int(*IDE_GetCursorY)();

// Set the cursor in the current editor. If the X or Y parameter is 0, the position will not change.
// This function will also update the position display in the statusbar.
// Available in version 510
/*FUNC: 143*/ extern void(*IDE_SetCursor)(int X, int Y);

// Create a bookmark at position X (character), Y (line). Index is the bookmark (0..9) you want
// to set. If you pass ? as bookmark, the first free bookmark will be used. The returned
// value is the used bookmark.
//
// Normally, from within PL/SQL Developer. Bookmarks can only be used for windows with a gutter
// (Test window and Program editor), but the Plug-In interface allows you to use bookmarks for
// all windows.
//
// Available in version 510
/*FUNC: 144*/ extern int(*IDE_SetBookmark)(int Index, int X, int Y);

// Clears the specified bookmark
// Available in version 510
/*FUNC: 145*/ extern void(*IDE_ClearBookmark)(int Index);

// Jumps to a bookmark
// Available in version 510
/*FUNC: 146*/ extern void(*IDE_GotoBookmark)(int Index);

// Get the cursor position for a specific bookmark
// Available in version 510
/*FUNC: 147*/ extern BOOL(*IDE_GetBookmark)(int Index, int X, int Y);

// Returns the description tab page Index (zero based). The return value is empty if the tab
// page does not exist. This function allows you to determine which tab pages (if any) are
// available for the current window.
//
// Available in version 511
/*FUNC: 148*/ extern char *(*IDE_TabInfo)(int Index);

// This function allows you to read or set the active tab page. To set a specific page, pass a
// zero based value to the Index parameter. The return value is the actual selected page. To
// determine the active page (without setting it) pass a value of ? to the Index parameter.
//
// Available in version 511
/*FUNC: 149*/ extern int(*IDE_TabIndex)(int Index);

// This function allows you to add Toolbuttons to your Plug-In, similar to IDE_CreatePopupItem.
// The ID is the Plug-In ID and the index is the menu index. When a button is selected,
// OnMenuClick is called with the corresponding index.
//
// The Name will appear as hint for the button, and as name in the preferences dialog.
//
// The button can be enabled and disabled with IDE_MenuState.
//
// 该按钮可以通过 IDE_MenuState 启用和禁用。
// 按钮的图像可以通过在 BitmapFile 参数中传递一个 bmp 文件的文件名来设置，或者作为内存中位图的句柄来设置。bmp 图像可以有任意数量的颜色，但大小应该大约为 20 x 20 像素。
// 只有在工具栏首选项中选中该按钮时，它才会可见。
// 从版本 510 开始可用
/*FUNC: 150*/ extern void(*IDE_CreateToolButton)(int ID, int Index, char *Name, char *BitmapFile, HBITMAP BitmapHandle);

// 如果当前窗口有编辑器，则返回 true。如果 CodeEditor 参数为 true，则对于像输出编辑器这样的编辑器返回 false。
// 从版本 710 开始可用
/*FUNC: 153*/ extern BOOL (*IDE_WindowHasEditor)(BOOL CodeEditor);
/*
注意：
BitmapHandle 参数曾经是一个 32 位整数，但是对于 64 位环境，它需要是 64 位。在 PL/SQL Developer 12.0 中，该参数从 Integer 更改为 HBITMAP，它根据目标平台是 32 位或 64 位。
声明曾经是：
extern void(*IDE_CreateToolButton)(int ID, int Index, char *Name, char *BitmapFile, int BitmapHandle);
*/

// 返回 PL/SQL 美化器选项。结果是一个值，其中以下值通过或运算组合在一起：
//   1 AfterCreating 启用
//   2 AfterLoading 启用
//   4 BeforeCompiling 启用
//   8 BeforeSaving 启用
// 你可以使用这个来确定是否需要调用美化器。
// 从版本 510 开始可用
/*FUNC: 160*/ extern int(*IDE_BeautifierOptions)();

// 为当前窗口调用 PL/SQL 美化器。结果指示操作是否成功。
// 从版本 510 开始可用
/*FUNC: 161*/ extern BOOL(*IDE_BeautifyWindow)();

// 调用 PL/SQL 美化器来美化 S 参数中的文本。结果是美化后的文本，如果函数失败则为空。
// 从版本 510 开始可用
/*FUNC: 162*/ extern char *(*IDE_BeautifyText)(char *S);

// 这个函数允许你对指定的对象执行特定的操作。
// 以下操作可用：
// VIEW, VIEWSPECANDBODY, EDIT, EDITSPECANDBODY, EDITDATA,
// QUERYDATA, TEST
// 从版本 514 开始可用
/*FUNC: 165*/ extern BOOL(*IDE_ObjectAction)(char *Action, char *ObjectType, char *ObjectOwner, char *ObjectName);

// 这允许你启动一个特定的 PL/SQL Developer 对话框。
// 以下是支持的对话框：
// AUTHORIZATIONS
// PROJECTITEMS
// BREAKPOINTS
// PREFERENCES
// CONFIG PLUGINS
// CONFIG TOOLS
// CONFIG DOCUMENTS
// CONFIG REPORTS
// CONFIG MACROS
// CONFIG AUTOREFRESH
// Param 参数供将来使用。
// 从版本 700 开始可用
/*FUNC: 166*/ extern BOOL(*IDE_ShowDialog)(char *Dialog, char *Param);

// 当调试开启时，这个函数允许你在生成的 debug.txt 文件中添加消息。
// 从版本 700 开始可用
/*FUNC: 173*/ extern void(*IDE_DebugLog)(char *Msg);

// 这个函数返回一个命令行参数，或者在 params.ini 文件中指定的参数。
// 从版本 700 开始可用
/*FUNC: 174*/ extern char* (*IDE_GetParamString)(char *Name);

// 这个函数返回一个命令行参数，或者在 params.ini 文件中指定的参数。
// 从版本 700 开始可用
/*FUNC: 175*/ extern BOOL(*IDE_GetParamBool)(char *Name);

// 这个函数返回定义的浏览器过滤器。如果插件有类似的需求，可以使用这个函数。索引从 0 开始，如果过滤器不存在，则返回的值为空。
// 从版本 702 开始可用
/*FUNC: 176*/ extern void (*IDE_GetBrowserFilter)(int Index, char **Name, char **WhereClause, char **OrderByClause, char **User, BOOL Active);

// 这个函数允许你向命令窗口返回反馈。描述 S 将显示在 FeedbackHandle 标识的窗口中。有关详细信息，请参阅 CommandLine 插件函数。
// 从版本 513 开始可用
/*FUNC: 180*/ extern void(*IDE_CommandFeedback)(int FeedbackHandle, char *S);

// 返回 SQL 或测试窗口结果网格中的行数。
// 从版本 516 开始可用
/*FUNC: 190*/ extern int(*IDE_ResultGridRowCount)();

// 返回 SQL 或测试窗口结果网格中的列数。
// 从版本 516 开始可用
/*FUNC: 191*/ extern int(*IDE_ResultGridColCount)();

// 这个函数允许你访问 SQL 或测试窗口中查询的结果。使用上面两个函数来确定行数和列数。
// 从版本 516 开始可用
/*FUNC: 192*/ extern char* (*IDE_ResultGridCell)(int Col, int Row);

// 返回 SQL 或测试窗口结果网格中可见列的数量。
// 从版本 1400 开始可用
/*FUNC: 193*/ extern int (*IDE_ResultGridVisibleColCount)();

// 在 PL/SQL Developer 6 中，我们引入了授权的概念。你应该使用此函数测试当前用户是否允许使用特定功能。在 Category 参数中，你可以指定一个主要类别（objects, menus, system）。名称参数指定项目（session.kill 或 objects.drop）。有些项目有子名称，比如 objects.drop 与不同的对象。
// 从版本 600 开始可用
/*FUNC: 200*/ extern BOOL(*IDE_Authorized)(char *Category, char *Name, char *SubName);

// 为了快速检查授权是否允许插件创建特定功能，你可以使用此函数。
// 从版本 600 开始可用
/*FUNC: 201*/ extern BOOL(*IDE_WindowAllowed)(int WindowType, BOOL ShowErrorMessage);

// 返回授权是否启用。
// 从版本 600 开始可用
/*FUNC: 202*/ extern BOOL(*IDE_Authorization)();

// 如果你想要所有可用授权项目的列表，可以调用此函数。它将返回一个以回车/换行符分隔的列表。
// 从版本 600 开始可用
/*FUNC: 203*/ extern char* (*IDE_AuthorizationItems)(char *Category);


// 如果你想向授权列表中添加项目，以便通过授权选项进行管理，可以使用此函数。传递 PlugInID 以标识你的插件，并在 Name 参数中传递你要添加的项目。名称应该是唯一的，所以你应该在前面加上插件的名称，例如：MyPlugIn.Create New Command。所有项目都将添加到 PlugIns 类别中，所以如果你想测试此功能是否允许，应该调用：IDE_Authorized('PlugIns ', ' MyPlugIn.Create New Command')。
// 从版本 600 开始可用
/*FUNC: 204*/ extern void(*IDE_AddAuthorizationItem)(int PlugInID, char *Name);

// 返回所有个人偏好设置的列表。如果你希望插件根据当前连接使用不同的偏好设置，可以使用此函数来构建可能的偏好设置列表。
// 从版本 600 开始可用
/*FUNC: 210*/ extern char* (*IDE_GetPersonalPrefSets)();

// 返回所有默认偏好设置的列表。
// 从版本 600 开始可用
/*FUNC: 211*/ extern char* (*IDE_GetDefaultPrefSets)();

// 从偏好设置中读取插件偏好设置。在 PL/SQL Developer 6 中，个人偏好设置存储在文件中，而不是注册表中。你仍然可以使用注册表，但如果你想将偏好设置存储在共享位置，可以使用此函数。传递你在 IdentifyPlugIn 调用中收到的 PlugInID。PrefSet 参数可以为空以检索默认偏好设置，或者你可以指定现有的偏好设置之一。
// 从版本600开始可用
/*FUNC: 212*/ extern BOOL(*IDE_GetPrefAsString)(int PlugInID, char * PrefSet, char *Name, char *Default);
// 与IDE_GetPrefAsString相同，但用于整数。
// 从版本600开始可用
/*FUNC: 213*/ extern int(*IDE_GetPrefAsInteger)(int PlugInID, char *PrefSet, char *Name, BOOL Default);

// 与IDE_GetPrefAsString相同，但用于布尔值。
// 从版本600开始可用
/*FUNC: 214*/ extern BOOL(*IDE_GetPrefAsBool)(int PlugInID, char *PrefSet, char *Name, BOOL Default);

// 设置插件偏好设置。传递你在IdentifyPlugIn调用中收到的PlugInID。PrefSet参数可以为空以设置默认偏好设置，或者你可以指定现有的偏好设置之一。返回值指示函数是否成功。
// 从版本600开始可用
/*FUNC: 215*/ extern BOOL(*IDE_SetPrefAsString)(int PlugInID, char *PrefSet, char *Name, char *Value);

// 与IDE_SetPrefAsString相同，但用于整数。
// 从版本600开始可用
/*FUNC: 216*/ extern BOOL(*IDE_SetPrefAsInteger)(int PlugInID, char *PrefSet, char *Name, int Value);

// 与IDE_SetPrefAsString相同，但用于布尔值。
// 从版本600开始可用
/*FUNC: 217*/ extern BOOL(*IDE_SetPrefAsBool)(int PlugInID, char *PrefSet, char *Name, BOOL Value);

// 返回通用偏好设置的值。名称可以在偏好设置ini文件的[Preferences]部分找到。
// 从版本700开始可用
/*FUNC: 218*/ extern char* (*IDE_GetGeneralPref)(char *Name);

// 这将覆盖默认应用程序行为。目前仅支持设置“NOFILEDATECHECK”，你可以传递“TRUE”或“FALSE”。
/*FUNC: 219*/ extern BOOL(*IDE_PlugInSetting)(int PlugInID, char *Setting, char *Value);

// 返回特定过程的重载数量。
// 结果 < 0 = 过程不存在
// 结果 > 0 = 重载数量
// 从版本700开始可用
/*FUNC: 220*/ extern int(*IDE_GetProcOverloadCount)(char *Owner, char *PackageName, char *ProcedureName);

// 显示一个对话框，允许用户选择一个重载过程。
// 结果 < 0 = 取消
// 结果 0 = 没有重载
// 结果 > 0 = 重载索引
// 从版本700开始可用
/*FUNC: 221*/ extern int(*IDE_SelectProcOverloading)(char *Owner, char *PackageName, char *ProcedureName);

// 此函数将返回会话工具网格中你看到的会话参数之一。只有在会话窗口处于活动状态时，你才会得到结果，因此这仅适用于为SESSIONWINDOW对象创建的弹出菜单。
// 从版本700开始可用
/*FUNC: 230*/ extern char* (*IDE_GetSessionValue)(char *Name);

// 你可以使用此函数检查数据库版本是否等于或高于指定版本。参数应采用aa.bb的格式，如09.02或10.00。
// 从版本700开始可用
/*FUNC: 231*/ extern BOOL (*IDE_CheckDBVersion)(char *Version);

// 在版本9.0中，引入了多个连接。此函数将遍历所有可用（最近）的连接。
// 你可以从ix = 0开始，直到收到false作为结果。其他参数返回每个连接的详细信息。
// 另请参阅函数IDE_GetConnectionInfoEx10()。
// 从版本900开始可用
/*FUNC: 240*/ extern BOOL (*IDE_GetConnectionInfoEx)(int ix, char **Username, char **Password, char **Database, char **ConnectAs);

// 在可用连接中搜索特定连接。
// 如果未找到，结果将返回-1，否则返回数组中的索引，如通过IDE_GetConnectionInfoEx()检索到的。
// 另请参阅IDE_FindConnectionEx10()。
// 从版本900开始可用
/*FUNC: 241*/ extern int (*IDE_FindConnection)(char *Username, char *Database);

// 此函数允许你添加一个连接。如果它已经存在，则不会添加两次。结果将是新的或现有的索引。
// 另请参阅IDE_AddConnectionEx10()。
// 从版本900开始可用
/*FUNC: 242*/ extern int (*IDE_AddConnection)(char *Username, char *Password, char *Database, char *ConnectAs);

// 这将连接指定的连接到数据库。如果需要密码，将出现登录对话框。
// 从版本900开始可用
/*FUNC: 243*/ extern BOOL (*IDE_ConnectConnection)(int ix);

// 将指定的连接设置为主连接。主连接由PL/SQL Developer用于对象浏览器和新窗口的默认连接。
// Available in version 900
/*FUNC: 244*/ extern BOOL (*IDE_SetMainConnection)(int ix);

// Retrieves the connection used by the current window.
// Use IDE_GetConnectionInfoEx() to get details.
// Available in version 900
/*FUNC: 245*/ extern int (*IDE_GetWindowConnection)();

// Sets the connection for the current window.
// Available in version 900
/*FUNC: 246*/ extern BOOL (*IDE_SetWindowConnection)(int x);

// Returns available connections. Use the ix parameter from 0 onwards to
// determine the connection until the function returns false. The ID and
// ParentID determine the parent child relation.
// Available in version 900
/*FUNC: 247*/ extern BOOL (*IDE_GetConnectionTree)(int ix, char **Description, char **Username, char **Password, char **Database, char **ConnectAs, int ID, int ParentID);

// Extents function IDE_GetConnectionInfoEx for use with Edition and
// Workspace introduced in Version 10.
// Available in version 1000
/*FUNC: 250*/ extern BOOL (*IDE_GetConnectionInfoEx10)(int ix, char **Username, char **Password, char **Database, char **ConnectAs, char **Edition, char **Workspace);

// Extents function IDE_FindConnection for use with Edition and
// Workspace introduced in Version 10.
// Available in version 1000
/*FUNC: 251*/ extern int (*IDE_FindConnectionEx10)(char *Username, char *Database, char *Edition, char *Workspace);

// Extents function IDE_AddConnection for use with Edition and
// Workspace introduced in Version 10.
// Available in version 1000
/*FUNC: 252*/ extern int (*IDE_AddConnectionEx10)(char *Username, char *Password, char *Database, char *ConnectAs, char *Edition, char *Workspace);

// Extents function IDE_GetConnectionTree for use with Edition and
// Workspace introduced in Version 10.
// Available in version 1000
/*FUNC: 253*/ extern BOOL (*IDE_GetConnectionTreeEx10)(int ix, char **Description, char **Username, char **Password, char **Database, char **ConnectAs, char **Edition, char **Workspace, int ID, int ParentID);

// Opens the difference viewer to compare text and / or files.Caption1 is the
// description of the text to compare and String1 is the text to compare.If
// you want to compare a file, pass �file?as caption and the full filename as
// String.The caption will become the filename.
// Caption1 and String1 appear on the left, Caption2 and String2 appear on
// the right.
// Function will return immediately after the diffrence window open.
// Available in version 1400
/*FUNC: 260*/ extern void(*IDE_ShowDifferences)(int PlugInID, char *Caption1, char *String1, char *Caption2, char * String2);

// Returns the values of specific compare preferences
// Available in version 1400
/*FUNC: 261*/ extern void(*IDE_GetDiffPrefs)(BOOL IgnoreCase, BOOL IgnoreSpace, BOOL IgnoreComment);

// Allows you to set compare preferences.
// Available in version 1400
/*FUNC: 262*/ extern void(*IDE_SetDiffPrefs)(BOOL IgnoreCase, BOOL IgnoreSpace, BOOL IgnoreComment);

// Compare text and / or files. Return the number of differences. To test if opening the difference viewer is required.
// Caption1 is the description of the text 
// to compare and String1 is the text to compare. If you want to compare a file, 
// pass �file?as caption and the full filename as String.The caption will become the filename.
// Available in version 1400
/*FUNC: 263*/ extern int(*IDE_TestDifferences)(int PlugInID, char *Caption1, char *String1, char *Caption2, char * String2);


//*****************************************************************************
//
//    SQL functions
//
//****X******************X************************X************************X***

// Executes the statement defined in the SQL parameter. The function returns 0 if successful,
// else the Oracle error number.
/*FUNC: 40*/ extern int(*SQL_Execute)(char *SQL);

// Returns the number of fields after a SQL_Execute.
/*FUNC: 41*/ extern int(*SQL_FieldCount)();

// Returns if there are any more rows to fetch.
/*FUNC: 42*/ extern BOOL(*SQL_Eof)();

// Returns the next row after a SQL_Execute. The function returns 0 if successful, else the
// Oracle error number.
/*FUNC: 43*/ extern int(*SQL_Next)();

// Returns the field specified by the Field parameter.
/*FUNC: 44*/ extern char *(*SQL_Field)(int Field);

// Returns the fieldname specified by the Field parameter.
/*FUNC: 45*/ extern char *(*SQL_FieldName)(int Field);

// Converts a fieldname into an index, which can be used in the SQL_Field, SQL_FieldName and
// SQL_FieldType functions. If the field does not exist, the return value is -1.
/*FUNC: 46*/ extern int(*SQL_FieldIndex)(char *Name);

// Normally, the SQL functions will use the main PL/SQL Developer Oracle
// session. If you want to make sure you don�t interfere with other
// transactions, and you want the PlugIn to use a private session, call this
// function.
// The return value indicates if the function succeeded.
// Available in version 600
/*FUNC: 50*/ extern BOOL(*SQL_UsePlugInSession)(int PlugInID);

// This function will cancel the previous function and set the Oracle session
// back to default.
// Available in version 600
/*FUNC: 51*/ extern void(*SQL_UseDefaultSession)(int PlugInID);

// Forces PL/SQL Developer to check if the current connection to the
// database is still open (and tries a re-connect if necessary). The return
// value indicates if there is a connection.
// Available in version 700
/*FUNC: 52*/ extern BOOL(*SQL_CheckConnection)();

// Returns sys.dbms_output for the current (PlugIn specific) session.
// Available in version 700
/*FUNC: 53*/ extern char* (*SQL_GetDBMSGetOutput)();

// This function declares a variable. Call this for al variables you use in the
// statement you pass in SQL_Execute.
// Available in version 700
/*FUNC: 54*/ extern void(*SQL_SetVariable)(char *Name, char *Value);

// This function will return the value of a variable.
// Available in version 700
/*FUNC: 55*/ extern char* (*SQL_GetVariable)(char *Name);

// Clear all declared variables. If you are finished doing a query it is a good
// idea to call this function to prevent errors for the next execute.
// Available in version 700
/*FUNC: 56*/ extern void(*SQL_ClearVariables)();

// This function allows you to specify the connection details used for the
// SQL functions for the PlugIn.If your Plug - In has a specific task for the
// current window, you can get the connection details with the
// IDE_GetWindowConnection() and IDE_GetConnectionInfoEx() functions.
// The return value indicates if the function succeeded.
// Available in version 900
/*FUNC: 57*/ extern BOOL (*SQL_SetPlugInSession)(int PlugInID, char *Username, char *Password, char *Database, char *ConnectAs);

// Return the fieldtype of a field.
// 3 = otInteger
// 4 = otFloat
// 5 = otString
// 8 = otLong
// 12 = otDate
// 24 = otLongRaw
/*FUNC: 47*/ extern int(*SQL_FieldType)(int Field);

// This function will return the error message for any error that occurred during:
// SQL_Execute
// SQL_Eof
// SQL_Next
// IDE_SetConnection
// Available in version 301
/*FUNC: 48*/ extern char *(*SQL_ErrorMessage)();

#ifndef _NO_PACK_
#pragma pack(pop)
#endif

void OnCreateInitPtrArray();

#endif   // __PlSqlDevFunctions_h_
